home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / AOCE folder / OCETemplates.lisp < prev   
Encoding:
Text File  |  1994-09-12  |  85.8 KB  |  1,727 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :TRAPS)             ; ***********************************************************
  3. ; Translated from pascal interface files by Kane Biomedical Systems, May 1993
  4. ; Created: Tuesday, February 23, 1993 at 6:15PM
  5. ;  OCETemplates.p
  6. ;  Pascal Interface to the Macintosh Libraries
  7. ;   Copyright Apple Computer, Inc. 1990-1993
  8. ;   All rights reserved
  9. ; ***********************************************************
  10.  
  11. ; $IFC UNDEFINED UsingIncludes
  12. ; $SETC UsingIncludes:= 0
  13. ; $ENDC
  14.  
  15. ; $IFC NOT UsingIncludes
  16.  
  17. ; $ENDC
  18.  
  19. ; $IFC UNDEFINED UsingOCETemplates
  20. ; $SETC UsingOCETemplates:= 1
  21.  
  22. ; $I+
  23. ; $SETC OCETemplatesIncludes:= UsingIncludes
  24. ; $SETC UsingIncludes:= 1
  25.  
  26. ; $IFC UNDEFINED UsingTypes
  27.  
  28. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  29. ; $ENDC
  30.  
  31. ; $IFC UNDEFINED UsingEvents
  32.  
  33. (require-interface 'EVENTS)     ; $I $$Shell(PInterfaces)Events.p
  34. ; $ENDC
  35.  
  36. ; $IFC UNDEFINED UsingOCE
  37. ; $I OCE.p
  38. ; $ENDC
  39.  
  40. ; $IFC UNDEFINED UsingOCEStandardMail
  41. ; $I OCEStandardMail.p
  42. ; $ENDC
  43.  
  44. ; $SETC UsingIncludes:= OCETemplatesIncludes
  45.  
  46. ; **********************************************************************************************
  47. ; ******************************** Template Resource Constants: ********************************
  48. ; **********************************************************************************************
  49.  
  50. ;  Current versions of all the different template types: 
  51.  
  52. (defconstant $kDETAspectVersion -978)
  53. (defconstant $kDETInfoPageVersion -978)
  54. (defconstant $kDETKillerVersion -978)
  55. (defconstant $kDETForwarderVersion -978)
  56. (defconstant $kDETFileTypeVersion -978)
  57.  
  58. ;  "Normal" separation for template IDs within the file (this is just a suggestion; you can use whatever
  59. ;     separation you like, so LONGINT as two separate templates don't have overlapping resources): 
  60. (defconstant $kDETIDSep 250)
  61.  
  62. ;  A few predefined base IDs (again, just suggestions): 
  63. (defconstant $kDETFirstID 1000)
  64. (defconstant $kDETSecondID (+ 1000 #$KDETIDSEP))
  65. (defconstant $kDETThirdID (+ 1000 (* 2 #$KDETIDSEP)))
  66. (defconstant $kDETFourthID (+ 1000 (* 3 #$KDETIDSEP)))
  67. (defconstant $kDETFifthID (+ 1000 (* 4 #$KDETIDSEP)))
  68.  
  69. ;  All templates include the following resource fork resources:
  70. ;     resource ('rstr', id+kDETTemplateName) contains the name of the template 
  71.  
  72. (defconstant $kDETTemplateName 0)
  73.  
  74. ;  Aspect, info-pages, and forwarders include the following as well:
  75. ;     resource ('rstr', id+kDETRecordType) contains the type of record this applies to
  76. ;     resource ('rstr', id+kDETAttributeType) contains the type of attribute this applies to
  77. ;     resource ('detn', id+kDETAttributeValueTag) contains the tag of the attribute this applies to
  78.  
  79. (defconstant $kDETRecordType 1)
  80. (defconstant $kDETAttributeType 2)
  81. (defconstant $kDETAttributeValueTag 3)
  82.  
  83. ;  ************************************ Aspects 
  84.  
  85. ;  In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  86. ;     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  87. ;     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  88. ;     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  89. ;     the case of kDETAspectName), it indicates the type for the dynamically generated property.
  90. ;      Type    Offset                        Description
  91. ;      ----    ------                        -----------
  92. ;     'deta'    0                            Identifies the type of resource
  93. ;     'detc'    kDETCode                    Is the code resource, if any is used
  94. ;     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  95. ;     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  96. ;     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  97. ;     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  98. ;     'rstr'    kDETAspectWhatIs            Is string for balloon help when item is in sublist (main aspect only)
  99. ;     'ICN#'    kDETAspectMainBitmap
  100. ;     'icl8'    kDETAspectMainBitmap
  101. ;     'icl4'    kDETAspectMainBitmap
  102. ;     'ics#'    kDETAspectMainBitmap
  103. ;     'ics8'    kDETAspectMainBitmap
  104. ;     'ics4'    kDETAspectMainBitmap
  105. ;     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  106. ;     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item is an info-page, it's
  107. ;                                         property # times 2 is used as an index into this array; if the item is not editable,
  108. ;                                         then the property # times 2 plus 1 is used
  109. ;     'rstr'    kDETAspectNewMenuName        Is the string to be used for "New ..." in the Directories menu, if any
  110. ;     'rstr'    kDETAspectNewEntryName        Is the name to be used for new entries (with a digit appended if not unique)
  111. ;     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  112. ;                                         is the tag; the rest is the attribute value contents
  113. ;     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  114. ;     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect
  115. ;     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  116. ;                                         can be dragged into this aspect, and the second is the attribute type to store
  117. ;                                         the reference in
  118. ;     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  119. ;                                         category of records which can be dragged in, and the second is the type of
  120. ;                                         attribute to place the alias in
  121. ;     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  122. ;                                         dragged from (or "=" for any), the second is the attribute type which can be dragged
  123. ;                                         in, and the third is the attribute type to store the new attribute in
  124. ;     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect
  125. ;     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  126. ;     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  127. ;     'ipcw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  128. ;                                             page-selector (main aspect only)
  129. ;                                             (note: this resource should not be used for normal info-pages)
  130. ;     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  131. ;                                         kDETAspectCategory; if this resource is not present, external names are taken from
  132. ;                                         another template; if no other template provides an external name for a given internal
  133. ;                                         category, the internal name is used as the external name (main aspect only)
  134.  
  135. (defconstant $kDETAspectCode 4)
  136. (defconstant $kDETAspectName 5)
  137. (defconstant $kDETAspectCategory 6)
  138. (defconstant $kDETAspectKind 7)
  139. (defconstant $kDETAspectGender 8)
  140. (defconstant $kDETAspectWhatIs 9)
  141. (defconstant $kDETAspectMainBitmap 10)
  142. (defconstant $kDETAspectBalloons 11)
  143. (defconstant $kDETAspectNewMenuName 12)
  144. (defconstant $kDETAspectNewEntryName 13)
  145. (defconstant $kDETAspectNewValue 14)
  146. (defconstant $kDETAspectLookup 15)
  147. (defconstant $kDETAspectDragInString 16)
  148. (defconstant $kDETAspectDragInVerb 17)
  149. (defconstant $kDETAspectDragInSummary 18)
  150. (defconstant $kDETAspectRecordDragIn 19)
  151. (defconstant $kDETAspectRecordCatDragIn 20)
  152. (defconstant $kDETAspectAttrDragIn 21)
  153. (defconstant $kDETAspectAttrDragOut 22)
  154. (defconstant $kDETAspectViewMenu 23)
  155. (defconstant $kDETAspectReverseSort 24)
  156. (defconstant $kDETAspectInfoPageCustomWindow 25)
  157. (defconstant $kDETAspectExternalCategory 26)
  158.  
  159. ;  Properties: 
  160.  
  161. ;  Each aspect has 250 attribute properties in this range: 
  162. (defconstant $kDETFirstLocalProperty 0)
  163. (defconstant $kDETLastLocalProperty (+ #$KDETFIRSTLOCALPROPERTY 249))
  164.  
  165. ;  Developers should use property numbers starting at this point: 
  166. (defconstant $kDETFirstDevProperty 40)
  167.  
  168. ;  Finally, the following range provide constant numeric properties for use in patterns and comparisons: 
  169. (defconstant $kDETFirstConstantProperty 250)
  170. (defconstant $kDETLastConstantProperty (+ #$KDETFIRSTCONSTANTPROPERTY 249))
  171.  
  172. ;  To convert a number into a constant property, add this: 
  173. (defconstant $kDETConstantProperty #$KDETFIRSTCONSTANTPROPERTY)
  174.  
  175. (defconstant $kDETZeroProperty (+ #$KDETCONSTANTPROPERTY 0))
  176. (defconstant $kDETOneProperty (+ #$KDETCONSTANTPROPERTY 1))
  177. (defconstant $kDETFalseProperty (+ #$KDETCONSTANTPROPERTY 0))
  178. (defconstant $kDETTrueProperty (+ #$KDETCONSTANTPROPERTY 1))
  179.  
  180. ;  The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: 
  181. (defconstant $kDETPrName 3050)
  182. (defconstant $kDETPrKind 3051)
  183.  
  184. ;  Access mask properties: 
  185. (defconstant $kDETDNodeAccessMask 27574);  the DNode access mask 
  186. (defconstant $kDETRecordAccessMask 27575);  the record access mask 
  187. (defconstant $kDETAttributeAccessMask 27576);  the attribute access mask 
  188. (defconstant $kDETPrimaryMaskByBit 27577);  a set of sixteen properties to access all bits of the primary mask 
  189.  
  190. ;  See OCE documentation for details definitions of each of these bits: 
  191.  
  192. (defconstant $kDETPrimarySeeMask #$KDETPRIMARYMASKBYBIT)
  193. (defconstant $kDETPrimaryAddMask (+ #$KDETPRIMARYMASKBYBIT 1))
  194. (defconstant $kDETPrimaryDeleteMask (+ #$KDETPRIMARYMASKBYBIT 2))
  195. (defconstant $kDETPrimaryChangeMask (+ #$KDETPRIMARYMASKBYBIT 3))
  196. (defconstant $kDETPrimaryRenameMask (+ #$KDETPRIMARYMASKBYBIT 4))
  197. (defconstant $kDETPrimaryChangePrivsMask (+ #$KDETPRIMARYMASKBYBIT 5))
  198. (defconstant $kDETPrimaryTopMaskBit (+ #$KDETPRIMARYMASKBYBIT 15))
  199.  
  200. ;  Template numbers (can be used with kDETAspectTemplate and kDETInfoPageTemplate target selectors): 
  201. (defconstant $kDETAspectTemplateNumber 22051)
  202. (defconstant $kDETInfoPageTemplateNumber 22052)
  203.  
  204. ;  Property types are used to specify types of properties and conversions between types (negative numbers
  205. ;     are reserved for Apple; developer code resources can use positive numbers): 
  206. (defconstant $kDETPrTypeNone 0) ;  No type 
  207. (defconstant $kDETPrTypeNumber -1);  A number 
  208. (defconstant $kDETPrTypeString -2);  A STRING 
  209. (defconstant $kDETPrTypeBinary -3);  A binary block 
  210.  
  211. ;  ************************************ Info-pages 
  212.  
  213. ;  Info-pages include the following as well:
  214. ;     resource ('deti', id) identifies the type of resource; see below for details on the contents
  215. ;     resource ('rstr', id+kDETInfoPageName) is the name of the view to use in the page selection pop-up
  216. ;     resource ('rstr', id+kDETInfoPageMainViewAspect) is the name of the aspect to use with the main page view
  217. ;     resource ('rstr', id+kDETInfoPageMenuName) is the name of the directories menu ("Directories" if nil)
  218. ;     resource ('detm', id+kDETInfoPageMenuEntries) are menu entries to add after a gray line after the "New..." entries;
  219. ;                                                     use "-" for a gray line between entries
  220.  
  221. (defconstant $kDETInfoPageName 4)
  222. (defconstant $kDETInfoPageMainViewAspect 5)
  223. (defconstant $kDETInfoPageMenuName 6)
  224. (defconstant $kDETInfoPageMenuEntries 7)
  225.  
  226. ;  ************************************ Views 
  227.  
  228. ;  Flags: 
  229.  
  230. (defconstant $kDETNoFlags #X0)  ; 0
  231. (defconstant $kDETEnabled #X1)  ; 1 << 0
  232. (defconstant $kDETHilightIfSelected #X1); 1 << 0
  233. (defconstant $kDETChoosable #X2); 1 << 1
  234. (defconstant $kDETNumericOnly #X8); 1 << 3
  235. (defconstant $kDETMultiLine #X10); 1 << 4
  236. (defconstant $kDETViewSendCommandToWindow #X20); 1 << 5
  237.  
  238. ;  The folowing flags make sense for views only 
  239.  
  240. ;  for EditText views only 
  241. (defconstant $kDETHidePenOnOpen #X100); 1 << 8
  242. (defconstant $kDETDynamicSize #X200); 1 << 9
  243. (defconstant $kDETAllowNoColons #X400); 1 << 10
  244.  
  245. ;     Sizes for icons4 
  246. (defconstant $kDETLargeIcon 0)
  247. (defconstant $kDETSmallIcon 1)
  248. (defconstant $kDETMiniIcon 2)
  249.  
  250. ;  Stolen from TextEdit.h 
  251. (defconstant $kDETLeft 0)
  252. (defconstant $kDETCenter 1)
  253. (defconstant $kDETRight -1)
  254. (defconstant $kDETForceLeft -2)
  255.  
  256. (defconstant $kDETUnused 0)
  257. (defconstant $kDETNoValue #X80000000)
  258. (defconstant $kDETNoSort 0)
  259. (defconstant $kDETNoProperty -1)
  260.  
  261. ;  Attributes for TViewBox - these are distinct from the flags above 
  262.  
  263. (defconstant $kDETBoxTakesContentClicks #X1); 1 << 0
  264. (defconstant $kDETBoxIsRounded #X2); 1 << 1
  265. (defconstant $kDETBoxIsGrayed #X4); 1 << 2
  266. (defconstant $kDETBoxIsInvisible #X8); 1 << 3
  267.  
  268. ;  The common font info 
  269. (defconstant $kDETApplicationFont 1)
  270. (defconstant $kDETApplicationFontSize 9)
  271. (defconstant $kDETAppFontLineHeight 12)
  272.  
  273. (defconstant $kDETSystemFont 0)
  274. (defconstant $kDETSystemFontSize 12)
  275. (defconstant $kDETSystemFontLineHeight 16)
  276.  
  277. (defconstant $kDETDefaultFont 1)
  278. (defconstant $kDETDefaultFontSize 9)
  279. (defconstant $kDETDefaultFontLineHeight 12)
  280.  
  281. ;  These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): 
  282. (defconstant $kDETNormal 0)
  283. (defconstant $kDETBold 1)
  284. (defconstant $kDETItalic 2)
  285. (defconstant $kDETUnderline 4)
  286. (defconstant $kDETOutline 8)
  287. (defconstant $kDETShadow #X10)
  288. (defconstant $kDETCondense #X20)
  289. (defconstant $kDETExtend #X40)
  290.  
  291. (defconstant $kDETIconStyle -3) ;  Normal for regular icons, italic for aliases 
  292.  
  293. ;  Views IDs: 
  294.  
  295. (defconstant $kDETCustomViewMenuID 10)
  296.  
  297. (defconstant $kDETChangeViewCommand :|view|);  Change the view; used especially in StaticCommandTextFromView sublist headers 
  298.  
  299. ;  Info-page window size: 
  300. (defconstant $kDETRecordInfoWindHeight 228)
  301. (defconstant $kDETRecordInfoWindWidth 400)
  302.  
  303. (defconstant $kDETAttributeInfoWindHeight 250)
  304. (defconstant $kDETAttributeInfoWindWidth 230)
  305.  
  306. ; kDETAppFontLineHeight             = 12;
  307.  
  308. ;  Note: The following defines set up an info-page layout which is for interim use only;
  309. ;     a more permanent layout will be defined later 
  310.  
  311. ;  Defines for subpages (template filled-in areas) 
  312. (defconstant $kDETSubpageTop 0)
  313. (defconstant $kDETSubpageLeft 64)
  314. (defconstant $kDETSubpageBottomInset 8)
  315. (defconstant $kDETSubpageRightInset 8)
  316.  
  317. ;  Page identifying icon 
  318. (defconstant $kDETSubpageIconTop 8)
  319. (defconstant $kDETSubpageIconLeft 8)
  320. (defconstant $kDETSubpageIconBottom (+ #$KDETSUBPAGEICONTOP 32))
  321. (defconstant $kDETSubpageIconRight (+ #$KDETSUBPAGEICONLEFT 32))
  322. ;  #define kDETSubpageIconRect        {kDETSubpageIconTop, kDETSubpageIconLeft, kDETSubpageIconBottom, kDETSubpageIconRight} 
  323.  
  324. ;  Page identifying label 
  325. (defconstant $kDETSubpageLabelTop (+ #$KDETSUBPAGEICONBOTTOM 8))
  326. (defconstant $kDETSubpageLabelLeft #$KDETSUBPAGEICONLEFT)
  327. (defconstant $kDETSubpageLabelBottom (+ #$KDETSUBPAGELABELTOP #$KDETAPPFONTLINEHEIGHT))
  328. (defconstant $kDETSubpageLabelRight (- #$KDETRECORDINFOWINDWIDTH 20))
  329. ;  #define kDETSubpageLabelRect    {kDETSubpageLabelTop, kDETSubpageLabelLeft, kDETSubpageLabelBottom, kDETSubpageLabelRight} 
  330.  
  331. ;  For pages with a single function, here's where the button goes 
  332. (defconstant $kDETSubpage1ButtonTop 120)
  333. (defconstant $kDETSubpage1ButtonLeft 110)
  334. (defconstant $kDETSubpage1ButtonBottom (+ #$KDETSUBPAGE1BUTTONTOP 50))
  335. (defconstant $kDETSubpage1ButtonRight (+ #$KDETSUBPAGE1BUTTONLEFT 200))
  336. ;  #define kDETSubpage1ButtonRect        {kDETSubpage1ButtonTop, kDETSubpage1ButtonLeft, kDETSubpage1ButtonBottom, kDETSubpage1ButtonRight} 
  337.  
  338. ;  Column placement for non-sublist placements 
  339. (defconstant $kDET1stColumnLeft (- #$KDETSUBPAGELEFT 10))
  340. (defconstant $kDET1stColumnRight (+ #$KDETSUBPAGELEFT 68))
  341. (defconstant $kDET2ndColumnLeft (+ #$KDET1STCOLUMNRIGHT 2))
  342. (defconstant $kDETRecord2ndColumnRight (- #$KDETRECORDINFOWINDWIDTH #$KDETSUBPAGERIGHTINSET))
  343. (defconstant $kDETAttribute2ndColumnRight (- #$KDETATTRIBUTEINFOWINDWIDTH #$KDETSUBPAGERIGHTINSET))
  344.  
  345. (defconstant $kDETColumnTop 38)
  346.  
  347. ;  Sublist placement 
  348. (defconstant $kDETSublistTop (+ #$KDETSUBPAGEICONBOTTOM (+ 16 (+ #$KDETAPPFONTLINEHEIGHT 4))))
  349. (defconstant $kDETSublistLeft 10)
  350. (defconstant $kDETSublistBottomInset 10)
  351. (defconstant $kDETSublistBottom (- #$KDETRECORDINFOWINDHEIGHT #$KDETSUBLISTBOTTOMINSET))
  352. (defconstant $kDETSublistRightInset 10)
  353. (defconstant $kDETSublistRight (- #$KDETRECORDINFOWINDWIDTH #$KDETSUBLISTRIGHTINSET))
  354.  
  355. ;  #define kDETSublistRect            { kDETSublistTop, kDETSublistLeft, kDETSublistBottom, kDETSublistRight } 
  356.  
  357. (defconstant $kDETSublistEntryTop (- #$KDETAPPFONTLINEHEIGHT/2))
  358. (defconstant $kDETSublistEntryBottom (+ #$KDETSUBLISTENTRYTOP #$KDETAPPFONTLINEHEIGHT))
  359.  
  360. ;  #define kDETSublistTitleBitmapRect            { kDETListTop-10, kDETListLeftInset+4, kDETListTop-4, kDETListLeftInset+4+16 } 
  361. (defconstant $kDETSublistTitleTop (- #$KDETSUBLISTTOP (- #$KDETAPPFONTLINEHEIGHT 2)))
  362. (defconstant $kDETSublistTitleBottom (- #$KDETSUBLISTTOP 2))
  363. (defconstant $kDETSublistIconColumnWidth 16)
  364. (defconstant $kDETSublistNameColumnWidth 200)
  365. (defconstant $kDETSublistKindColumnWidth 96)
  366. (defconstant $kDETSublistSpaceBetweenColumns 2)
  367. (defconstant $kDETSublistIconColumnLeft #$KDETSUBLISTSPACEBETWEENCOLUMNS)
  368. (defconstant $kDETSublistIconColumnRight (+ #$KDETSUBLISTICONCOLUMNLEFT #$KDETSUBLISTICONCOLUMNWIDTH))
  369. (defconstant $kDETSublistNameColumnLeft (+ #$KDETSUBLISTICONCOLUMNRIGHT #$KDETSUBLISTSPACEBETWEENCOLUMNS))
  370. (defconstant $kDETSublistNameColumnRight (+ #$KDETSUBLISTNAMECOLUMNLEFT #$KDETSUBLISTNAMECOLUMNWIDTH))
  371. (defconstant $kDETSublistKindColumnLeft (+ #$KDETSUBLISTNAMECOLUMNRIGHT 8));  need extra space because size is right-justified 
  372. (defconstant $kDETSublistKindColumnRight (+ #$KDETSUBLISTKINDCOLUMNLEFT #$KDETSUBLISTKINDCOLUMNWIDTH))
  373.  
  374. ;  ************************************ Killers 
  375.  
  376. ;  Killers include the following as well:
  377. ;     resource ('rst#', id+kDETKillerName) contains a list of names to be killed
  378.  
  379. (defconstant $kDETKillerName 1)
  380.  
  381. ;  ************************************ Forwarders 
  382.  
  383. ;  Forwarders include the following as well:
  384. ;     resource ('rst#', id+kDETForwarderAspectNames) contains a list of names of aspects to forward to
  385. ;     resource ('rst#', id+kDETInfoPageNames) contains a list of names of info-pages to forward to
  386.  
  387. (defconstant $kDETForwarderTemplateNames 4)
  388.  
  389. ; *********************************************************************************
  390. ; ******************************** Categories: ************************************
  391. ; *********************************************************************************
  392.  
  393. ;  Internal category names: 
  394.  
  395. (defconstant $kDETCategoryAllCategories "All Categories");  Everything in a specific category 
  396. (defconstant $kDETCategoryAllItems "All Items");  Everything in or out of a category 
  397. (defconstant $kDETCategoryAddressItems "Address Items");  Anything that can be used to address something 
  398. (defconstant $kDETCategoryPeople "People");  People 
  399.  
  400. ; *********************************************************************************
  401. ; ******************************** Code Resources: ********************************
  402. ; *********************************************************************************
  403.  
  404. ;  Target specification: 
  405.  
  406. ;  Values of DETTargetSelector 
  407. (defconstant $kDETSelf 0)       ;  The "current" item 
  408. (defconstant $kDETSelfOtherAspect 1);  Another aspect of the current item 
  409. (defconstant $kDETParent 2)     ;  The parent (i.e., the aspect we're in the sublist of, if any) of the current item 
  410. (defconstant $kDETSublistItem 3);  The ith item in the sublist 
  411. (defconstant $kDETSelectedSublistItem 4);  The ith selected item in the sublist 
  412. (defconstant $kDETDSSpec 5)     ;  The item specified by the packed DSSpec 
  413. (defconstant $kDETChainedTargetSpec 6);  A chain of specifications (apply each specification in the chain in sequence) 
  414. (defconstant $kDETAspectTemplate 7);  A specific aspect template (number itemNumber) 
  415. (defconstant $kDETInfoPageTemplate 8);  A specific info-page template (number itemNumber) 
  416. (defconstant $kDETHighSelector #XF000);  Force type to be INTEGER 
  417.  
  418. (def-mactype :DETTARGETSELECTOR (find-mactype :SIGNED-LONG))
  419.  
  420. (defrecord DETTargetSpecification 
  421.    (selector :SIGNED-LONG)      ;  How to pick the item (above: see) 
  422.    (aspectName (:POINTER :RSTRING));  The name of the aspect (kDETSelfOtherAspect, kDETParentOtherAspect,
  423. ;                                             kDETSublistItem, kDETSelectedSublistItem, kDETDSSpec); nil for main aspect 
  424.    (itemNumber :SIGNED-LONG)    ;  Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate) 
  425.    (dsSpec (:POINTER :PACKEDDSSPEC));  DSSpec (only: kDETDSSpec) 
  426.    (next (:POINTER :DETTARGETSPECIFICATION));  Next item in chain (used only when original item was kChainedTargetSpec) 
  427.    )
  428.  
  429. ;  Code resource calls and call-backs both return an OSType:
  430. ;         kDETDidNotHandle (1) = function not completed, try something else (used by template to say "I didn't handle it");
  431. ;         noErr = function completed successfully;
  432. ;         any error = function failed, and here's why
  433.  
  434. (defconstant $kDETDidNotHandle 1)
  435.  
  436. ;  Call-back functions:
  437. ;         reqFunction                            Action
  438. ;         -----------                            ------
  439. ;         kDETcmdBeep                            Call SysBeep; useful for testing that a code resource's calls/call-backs are working at all
  440. ;         kDETcmdBusy                            Put up watch cursor and switch processes; user events elicit a beep
  441. ;         kDETcmdChangeCallFors                Change call-fors mask
  442. ;         kDETcmdGetCommandSelectionCount        Get the command selection count (for calls which have a command selection list)
  443. ;         kDETcmdGetCommandItemN                Get command selection item n (for calls which have a command selection list)
  444. ;         kDETcmdGetDSSpec                    Get the PackedDSSpec for this object
  445. ;         kDETcmdGetTemplateFSSpec            Get the FSSpec of the file containing the template (should be seldom used)
  446. ;         kDETcmdGetOpenEdit                    Return the property of the view being edited (if any)
  447. ;         kDETcmdCloseEdit                    Close the current edit
  448. ;         kDETcmdGetPropertyType                Get a property type
  449. ;         kDETcmdGetPropertyNumber            Get a property, number format
  450. ;         kDETcmdGetPropertyRString            Get a property, RString format
  451. ;         kDETcmdGetPropertyBinarySize        Get a property, binary, return size
  452. ;         kDETcmdGetPropertyBinary            Get a property, binary format
  453. ;         kDETcmdGetPropertyChanged            Get a property changed flag
  454. ;         kDETcmdGetPropertyEditable            Get a property editable flag
  455. ;         kDETcmdSetPropertyType                Set a property type
  456. ;         kDETcmdSetPropertyNumber            Set a property, number format
  457. ;         kDETcmdSetPropertyRString            Set a property, RString format
  458. ;         kDETcmdSetPropertyBinary            Set a property, binary data & size
  459. ;         kDETcmdSetPropertyChanged            Set a property changed flag
  460. ;         kDETcmdSetPropertyEditable            Set a property editable flag
  461. ;         kDETcmdDirtyProperty                Dirty a property (redraw: force)
  462. ;         kDETcmdSublistCount                    Return the count of the sublist items
  463. ;         kDETcmdSelectedSublistCount            Return the count of the selected sublist items
  464. ;         kDETcmdRequestSync                    Request a sync-up of the aspect with the directory
  465. ;         kDETcmdAddMenu                        Add to the end of a dynamic menu
  466. ;         kDETcmdRemoveMenu                    Remove a dynamic menu item
  467. ;         kDETcmdMenuItemRString                Get a dynamic menu item RString
  468. ;         kDETcmdOpenDSSpec                    PackedDSSpec open (can also be done via AppleEvents -- this is a short-cut)
  469. ;         kDETcmdAboutToTalk                    About to talk to user: bring us to front, disable watch cursor, etc.
  470. ;         kDETcmdBreakAttribute                Break an attribute -- apply all applicable patterns to an attribute to generate properties
  471. ;         kDETcmdSaveProperty                    Force a save of a property -- apply all applicable patterns to write out the property
  472. ;         kDETcmdGetCustomViewUserReference    Get custom view user reference (as given in .r file)
  473. ;         kDETcmdGetCustomViewBounds            Get custom view current bounds
  474. ;         kDETcmdGetResource                    Get a resource from a template
  475. ;         kDETcmdTemplateCounts                Return number of aspect and info-page templates in system
  476. ;         kDETcmdUnloadTemplates                Flush templates
  477.  
  478. ; Values of DETCallBackFunctions 
  479. (defconstant $kDETcmdSimpleCallback 0)
  480. (defconstant $kDETcmdBeep 1)
  481. (defconstant $kDETcmdBusy 2)
  482. (defconstant $kDETcmdChangeCallFors 3)
  483. (defconstant $kDETcmdGetCommandSelectionCount 4)
  484. (defconstant $kDETcmdGetCommandItemN 5)
  485. (defconstant $kDETcmdOpenDSSpec 6)
  486. (defconstant $kDETcmdAboutToTalk 7)
  487. (defconstant $kDETcmdUnloadTemplates 8)
  488. (defconstant $kDETcmdTemplateCounts 9)
  489.  
  490. (defconstant $kDETcmdTargetedCallback 1000)
  491. (defconstant $kDETcmdGetDSSpec 1001)
  492. (defconstant $kDETcmdSublistCount 1002)
  493. (defconstant $kDETcmdSelectedSublistCount 1003)
  494. (defconstant $kDETcmdRequestSync 1004)
  495. (defconstant $kDETcmdBreakAttribute 1005)
  496. (defconstant $kDETcmdGetTemplateFSSpec 1006)
  497. (defconstant $kDETcmdGetOpenEdit 1007)
  498. (defconstant $kDETcmdCloseEdit 1008)
  499.  
  500. (defconstant $kDETcmdPropertyCallback 2000)
  501. (defconstant $kDETcmdGetPropertyType 2001)
  502. (defconstant $kDETcmdGetPropertyNumber 2002)
  503. (defconstant $kDETcmdGetPropertyRString 2003)
  504. (defconstant $kDETcmdGetPropertyBinarySize 2004)
  505. (defconstant $kDETcmdGetPropertyBinary 2005)
  506. (defconstant $kDETcmdGetPropertyChanged 2006)
  507. (defconstant $kDETcmdGetPropertyEditable 2007)
  508. (defconstant $kDETcmdSetPropertyType 2008)
  509. (defconstant $kDETcmdSetPropertyNumber 2009)
  510. (defconstant $kDETcmdSetPropertyRString 2010)
  511. (defconstant $kDETcmdSetPropertyBinary 2011)
  512. (defconstant $kDETcmdSetPropertyChanged 2012)
  513. (defconstant $kDETcmdSetPropertyEditable 2013)
  514. (defconstant $kDETcmdDirtyProperty 2014)
  515. (defconstant $kDETcmdAddMenu 2015)
  516. (defconstant $kDETcmdRemoveMenu 2016)
  517. (defconstant $kDETcmdMenuItemRString 2017)
  518. (defconstant $kDETcmdSaveProperty 2018)
  519. (defconstant $kDETcmdGetCustomViewUserReference 2019)
  520. (defconstant $kDETcmdGetCustomViewBounds 2020)
  521. (defconstant $kDETcmdGetResource 2021)
  522.  
  523. (defconstant $kDETcmdHighCallback #XF0000000);  Force type to be LONGINT 
  524.  
  525. (def-mactype :DETCALLBACKFUNCTIONS (find-mactype :SIGNED-LONG))
  526.  
  527. (defrecord DETCallBackBlockHeader 
  528.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  529.    )
  530.  
  531. (defrecord DETCallBackBlockTargetedHeader 
  532.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  533.    (target :DETTARGETSPECIFICATION);  The target for the request 
  534.    )
  535.  
  536. (defrecord DETCallBackBlockPropertyHeader 
  537.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  538.    (target :DETTARGETSPECIFICATION);  The target for the request 
  539.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  540.    )
  541.  
  542. (%define-record :DETPROTOCALLBACKBLOCK (find-record-descriptor :DETCALLBACKBLOCKPROPERTYHEADER))
  543.  
  544. (%define-record :DETBEEPBLOCK (find-record-descriptor :DETCALLBACKBLOCKHEADER))
  545.  
  546. (%define-record :DETBUSYBLOCK (find-record-descriptor :DETCALLBACKBLOCKHEADER))
  547.  
  548. (defrecord DETChangeCallForsBlock 
  549.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  550.    (target :DETTARGETSPECIFICATION);  The target for the request 
  551.  
  552.    (newCallFors :SIGNED-LONG)   ;   -> New call-for mask 
  553.    )
  554.  
  555. (defrecord DETGetCommandSelectionCountBlock 
  556.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  557.  
  558.    (count :SIGNED-LONG)         ;  <-  The number of items in the command selection list 
  559.    )
  560.  
  561. ; Values of DETItemType 
  562. (defconstant $kDETHFSType 0)    ;  HFS item type 
  563. (defconstant $kDETDSType 1)     ;  Directory Service item type 
  564. (defconstant $kDETMailType 2)   ;  Mail (letter) item type 
  565. (defconstant $kDETMoverType 3)  ;  Sounds, fonts, etc., from inside a suitcase or system file 
  566. (defconstant $kDETLastItemType #XF0000000);  Force it to be a LONGINT (C & C++ seem to disagree about the definition of $F000) 
  567.  
  568. (def-mactype :DETITEMTYPE (find-mactype :SIGNED-LONG))
  569.  
  570. (defrecord (DETFSInfo :handle)  ;  FSSpec plus possibly interesting additional info 
  571.    (fileType :OSTYPE)           ;  File type 
  572.    (fileCreator :OSTYPE)        ;  File creator 
  573.    (fdFlags :SIGNED-INTEGER)    ;  Finder flags 
  574.    (FSSpec :FSSPEC)             ;  FSSpec 
  575.    )
  576.  
  577. (def-mactype :DETFSINFOPTR (find-mactype :POINTER))
  578.  
  579. (def-mactype :LETTERSPECPTR (find-mactype :POINTER))
  580. (def-mactype :LETTERSPECHANDLE (find-mactype :HANDLE))
  581.  
  582. ;  added by JBK to work around the pascal unnamed record problem 
  583. (defrecord DSRec 
  584.    (dsSpec (:HANDLE :PACKEDDSSPEC));  <-  DSSpec for item (caller must disposHandle() when done) 
  585.    (refNum :SIGNED-INTEGER)     ;  <-  Refnum for returned address 
  586.    (identity :SIGNED-LONG)      ;  <-  Identity for returned address 
  587.    )
  588.  
  589. (defrecord DETGetCommandItemNBlock 
  590.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  591.  
  592.    (itemNumber :SIGNED-LONG)    ;   -> Item number to retrieve (1-based) 
  593.    (itemType :SIGNED-LONG)      ;   -> Type of item to be returned (if we can interpret it as such) 
  594.    (:variant 
  595.       ((fsInfo (:HANDLE :DETFSINFO)));  <-  FSSpec & info for item (caller must disposHandle() when done) 
  596.       ((ds :DSREC))             ;  PATCHED BY JBK on 5/4/93 (see above) 
  597.  
  598.       ((dsSpec (:HANDLE :PACKEDDSSPEC)));  <-  DSSpec for item (caller must disposHandle() when done) 
  599.       ((ltrSpec (:HANDLE :LETTERSPEC)));  <-  Letter spec for item (caller must disposHandle() when done) 
  600.       ))
  601.  
  602. (defrecord DETGetDSSpecBlock 
  603.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  604.    (target :DETTARGETSPECIFICATION);  The target for the request 
  605.  
  606.    (dsSpec (:HANDLE :PACKEDDSSPEC));  <-  Handle with result (caller must disposHandle() when done) 
  607.    (refNum :SIGNED-INTEGER)     ;  <-  Refnum for address if PD 
  608.    (identity :SIGNED-LONG)      ;  <-  Identity for address 
  609.    (isAlias :BOOLEAN)           ;  <-  True if this entry is an alias 
  610.    (isRecordRef :BOOLEAN)       ;  <-  True if this entry is a record reference 
  611.    )
  612.  
  613. (defrecord DETGetTemplateFSSpecBlock 
  614.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  615.    (target :DETTARGETSPECIFICATION);  The target for the request 
  616.  
  617.    (FSSpec :FSSPEC)             ;  <-  FSSpec of template file 
  618.    (baseID :SIGNED-INTEGER)     ;  <-  Base ID of this template 
  619.    (aspectTemplateNumber :SIGNED-LONG);  <-  The template number for this aspect template 
  620.    )
  621.  
  622. (defrecord DETGetOpenEditBlock 
  623.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  624.    (target :DETTARGETSPECIFICATION);  The target for the request 
  625.  
  626.    (viewProperty :SIGNED-INTEGER);  <- The property of the view being edited (or kNoProperty if none) 
  627.    )
  628.  
  629. (defrecord DETCloseEditBlock 
  630.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  631.    (target :DETTARGETSPECIFICATION);  The target for the request 
  632.  
  633.    )
  634.  
  635. (defrecord DETGetPropertyTypeBlock 
  636.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  637.    (target :DETTARGETSPECIFICATION);  The target for the request 
  638.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  639.  
  640.    (propertyType :SIGNED-INTEGER);  <-  The type of the property 
  641.    )
  642.  
  643. (defrecord DETGetPropertyNumberBlock 
  644.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  645.    (target :DETTARGETSPECIFICATION);  The target for the request 
  646.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  647.  
  648.    (propertyValue :SIGNED-LONG) ;  <-  The value of the property 
  649.    )
  650.  
  651. (defrecord DETGetPropertyRStringBlock 
  652.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  653.    (target :DETTARGETSPECIFICATION);  The target for the request 
  654.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  655.  
  656.    (propertyValue (:HANDLE :RSTRING));  <-  A handle containing the property (as an RString) (caller must disposHandle() when done) 
  657.    )
  658.  
  659. (defrecord DETGetPropertyBinarySizeBlock 
  660.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  661.    (target :DETTARGETSPECIFICATION);  The target for the request 
  662.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  663.  
  664.    (propertyBinarySize :SIGNED-LONG);  <-  The size of the property as a binary block 
  665.    )
  666.  
  667. (defrecord DETGetPropertyBinaryBlock 
  668.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  669.    (target :DETTARGETSPECIFICATION);  The target for the request 
  670.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  671.  
  672.    (propertyValue :HANDLE)      ;  <-  Handle with the value of the property (caller must disposHandle() when done) 
  673.    )
  674.  
  675. (defrecord DETGetPropertyChangedBlock 
  676.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  677.    (target :DETTARGETSPECIFICATION);  The target for the request 
  678.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  679.  
  680.    (propertyChanged :BOOLEAN)   ;  <-  True if the property is marked as changed 
  681.    )
  682.  
  683. (defrecord DETGetPropertyEditableBlock 
  684.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  685.    (target :DETTARGETSPECIFICATION);  The target for the request 
  686.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  687.  
  688.    (propertyEditable :BOOLEAN)  ;  <-  True if the property can be edited by the user 
  689.    )
  690.  
  691. (defrecord DETSetPropertyTypeBlock 
  692.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  693.    (target :DETTARGETSPECIFICATION);  The target for the request 
  694.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  695.  
  696.    (newType :SIGNED-INTEGER)    ;   -> New type for property (just sets type, does not convert contents) 
  697.    )
  698.  
  699. (defrecord DETSetPropertyNumberBlock 
  700.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  701.    (target :DETTARGETSPECIFICATION);  The target for the request 
  702.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  703.  
  704.    (newValue :SIGNED-LONG)      ;   -> New value to set property to (and set type to number) 
  705.    )
  706.  
  707. (defrecord DETSetPropertyRStringBlock 
  708.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  709.    (target :DETTARGETSPECIFICATION);  The target for the request 
  710.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  711.  
  712.    (newValue (:POINTER :RSTRING));   -> New value to set property to (and set type to RString) 
  713.    )
  714.  
  715. (defrecord DETSetPropertyBinaryBlock 
  716.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  717.    (target :DETTARGETSPECIFICATION);  The target for the request 
  718.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  719.  
  720.    (newValue :POINTER)          ;   -> New value to set property to (and set type to binary) 
  721.    (newValueSize :SIGNED-LONG)  ;   -> Size of new value 
  722.    )
  723.  
  724. (defrecord DETSetPropertyChangedBlock 
  725.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  726.    (target :DETTARGETSPECIFICATION);  The target for the request 
  727.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  728.  
  729.    (propertyChanged :BOOLEAN)   ;   -> Value to set changed flag on property to 
  730.    )
  731.  
  732. (defrecord DETSetPropertyEditableBlock 
  733.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  734.    (target :DETTARGETSPECIFICATION);  The target for the request 
  735.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  736.  
  737.    (propertyEditable :BOOLEAN)  ;   -> Value to set editable flag on property to 
  738.    )
  739.  
  740. (%define-record :DETDIRTYPROPERTYBLOCK (find-record-descriptor :DETCALLBACKBLOCKPROPERTYHEADER))
  741.  
  742. (defrecord DETSublistCountBlock 
  743.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  744.    (target :DETTARGETSPECIFICATION);  The target for the request 
  745.  
  746.    (count :SIGNED-LONG)         ;  <-  The number of items in the current item's sublist 
  747.    )
  748.  
  749. (defrecord DETSelectedSublistCountBlock 
  750.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  751.    (target :DETTARGETSPECIFICATION);  The target for the request 
  752.  
  753.    (count :SIGNED-LONG)         ;  <-  The number of selected items in the current item's sublist 
  754.    )
  755.  
  756. (%define-record :DETREQUESTSYNCBLOCK (find-record-descriptor :DETCALLBACKBLOCKTARGETEDHEADER))
  757.  
  758. (defrecord DETAddMenuBlock 
  759.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  760.    (target :DETTARGETSPECIFICATION);  The target for the request 
  761.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  762.  
  763.    (name (:POINTER :RSTRING))   ;   -> Name of new menu item 
  764.    (parameter :SIGNED-LONG)     ;   -> Parameter to return when this item is selected 
  765.    (addAfter :SIGNED-LONG)      ;   -> Parameter of entry to add after, or -1 for add at end 
  766.    )
  767.  
  768. (defrecord DETRemoveMenuBlock 
  769.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  770.    (target :DETTARGETSPECIFICATION);  The target for the request 
  771.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  772.  
  773.    (itemToRemove :SIGNED-LONG)  ;   -> Parameter of menu item to remove 
  774.    )
  775.  
  776. (defrecord DETMenuItemRStringBlock 
  777.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  778.    (target :DETTARGETSPECIFICATION);  The target for the request 
  779.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  780.  
  781.    (itemParameter :SIGNED-LONG) ;   -> Parameter of menu item to return STRING for 
  782.    (rString (:HANDLE :RSTRING)) ;  <-  Handle with the RString (caller must disposHandle() when done) 
  783.    )
  784.  
  785. (defrecord DETOpenDSSpecBlock 
  786.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  787.  
  788.    (dsSpec (:POINTER :PACKEDDSSPEC));   -> DSSpec of object to be opened 
  789.    )
  790.  
  791. (%define-record :DETABOUTTOTALKBLOCK (find-record-descriptor :DETCALLBACKBLOCKHEADER))
  792.  
  793. (defrecord DETBreakAttributeBlock 
  794.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  795.    (target :DETTARGETSPECIFICATION);  The target for the request 
  796.  
  797.    (breakAttribute (:POINTER :ATTRIBUTE));   -> Attribute to parse 
  798.    )
  799.  
  800. (%define-record :DETSAVEPROPERTYBLOCK (find-record-descriptor :DETCALLBACKBLOCKPROPERTYHEADER))
  801.  
  802. (defrecord DETGetCustomViewUserReferenceBlock 
  803.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  804.    (target :DETTARGETSPECIFICATION);  The target for the request 
  805.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  806.  
  807.    (userReference :SIGNED-INTEGER);  <-  User reference value, as specified in the .r file 
  808.    )
  809.  
  810. (defrecord DETGetCustomViewBoundsBlock 
  811.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  812.    (target :DETTARGETSPECIFICATION);  The target for the request 
  813.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  814.  
  815.    (bounds :RECT)               ;  <-  Bounds of the view 
  816.    )
  817.  
  818. (defrecord DETGetResourceBlock 
  819.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  820.    (target :DETTARGETSPECIFICATION);  The target for the request 
  821.    (property :SIGNED-INTEGER)   ;  The property to apply the request to 
  822.  
  823.    (resourceType :OSTYPE)       ;   -> Resource type 
  824.    (theResource :HANDLE)        ;  <-  The resource handle (caller must dispose when done) 
  825.    )
  826.  
  827. (defrecord DETTemplateCounts 
  828.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  829.  
  830.    (aspectTemplateCount :SIGNED-LONG);  <-  Number of aspect templates in the system 
  831.    (infoPageTemplateCount :SIGNED-LONG);  <-  Number of info-page templates in the system 
  832.    )
  833.  
  834. (%define-record :DETUNLOADTEMPLATESBLOCK (find-record-descriptor :DETCALLBACKBLOCKHEADER))
  835.  
  836. (defrecord DETCallBackBlock 
  837.    (:variant 
  838.       ((protoCallBack :DETCALLBACKBLOCKPROPERTYHEADER))
  839.       ((beep :DETCALLBACKBLOCKHEADER))
  840.       ((busy :DETCALLBACKBLOCKHEADER))
  841.       ((changeCallFors :DETCHANGECALLFORSBLOCK))
  842.       ((getCommandSelectionCount :DETGETCOMMANDSELECTIONCOUNTBLOCK))
  843.       ((getCommandItemN :DETGETCOMMANDITEMNBLOCK))
  844.       ((getDSSpec :DETGETDSSPECBLOCK))
  845.       ((getTemplateFSSpec :DETGETTEMPLATEFSSPECBLOCK))
  846.       ((getOpenEdit :DETGETOPENEDITBLOCK))
  847.       ((closeEdit :DETCLOSEEDITBLOCK))
  848.       ((getPropertyType :DETGETPROPERTYTYPEBLOCK))
  849.       ((getPropertyNumber :DETGETPROPERTYNUMBERBLOCK))
  850.       ((getPropertyRString :DETGETPROPERTYRSTRINGBLOCK))
  851.       ((getPropertyBinarySize :DETGETPROPERTYBINARYSIZEBLOCK))
  852.       ((getPropertyBinary :DETGETPROPERTYBINARYBLOCK))
  853.       ((getPropertyChanged :DETGETPROPERTYCHANGEDBLOCK))
  854.       ((getPropertyEditable :DETGETPROPERTYEDITABLEBLOCK))
  855.       ((setPropertyType :DETSETPROPERTYTYPEBLOCK))
  856.       ((setPropertyNumber :DETSETPROPERTYNUMBERBLOCK))
  857.       ((setPropertyRString :DETSETPROPERTYRSTRINGBLOCK))
  858.       ((setPropertyBinary :DETSETPROPERTYBINARYBLOCK))
  859.       ((setPropertyChanged :DETSETPROPERTYCHANGEDBLOCK))
  860.       ((setPropertyEditable :DETSETPROPERTYEDITABLEBLOCK))
  861.       ((dirtyProperty :DETCALLBACKBLOCKPROPERTYHEADER))
  862.       ((sublistCount :DETSUBLISTCOUNTBLOCK))
  863.       ((selectedSublistCount :DETSELECTEDSUBLISTCOUNTBLOCK))
  864.       ((requestSync :DETCALLBACKBLOCKTARGETEDHEADER))
  865.       ((addMenu :DETADDMENUBLOCK))
  866.       ((removeMenu :DETREMOVEMENUBLOCK))
  867.       ((menuItemRString :DETMENUITEMRSTRINGBLOCK))
  868.       ((openDSSpec :DETOPENDSSPECBLOCK))
  869.       ((aboutToTalk :DETCALLBACKBLOCKHEADER))
  870.       ((breakAttribute :DETBREAKATTRIBUTEBLOCK))
  871.       ((saveProperty :DETCALLBACKBLOCKPROPERTYHEADER))
  872.       ((getCustomViewUserReference :DETGETCUSTOMVIEWUSERREFERENCEBLOCK))
  873.       ((getCustomViewBounds :DETGETCUSTOMVIEWBOUNDSBLOCK))
  874.       ((getResource :DETGETRESOURCEBLOCK))
  875.       ((templateCounts :DETTEMPLATECOUNTS))
  876.       ((unloadTemplates :DETCALLBACKBLOCKHEADER))
  877.       ))
  878.  
  879. (def-mactype :DETCALLBACKBLOCKPTR (find-mactype :POINTER))
  880.  
  881. (def-mactype :DETCALLBACK (find-mactype :POINTER))
  882. ;  FUNCTION DETCallBack(
  883. ;         callBlockPtr: ^DETCallBlock, DETCallBackBlockPtr callBackBlockPtr): OSErr;
  884.  
  885. ;  Call functions:
  886. ;         reqFunction                        Action
  887. ;         -----------                        ------
  888. ;         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  889. ;         kDETcmdExit                        Called once when template is freed (good time to free private data)
  890. ;         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  891. ;         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  892. ;         kDETcmdIdle                        Called periodically during idle times
  893. ;         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  894. ;         kDETcmdControlEnabled            Called to determine if a control is enabled
  895. ;         kDETcmdMaximumTextLength        Return maximum size for text form of property
  896. ;         kDETcmdViewListChanged            Called when the window view-list (list of enabled views) has changed
  897. ;         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  898. ;         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (1: or) if it's OK to do so
  899. ;         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  900. ;         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  901. ;         kDETcmdAttributeCreation        New attribute creation about to occur; this gives the template chance to modify
  902. ;                                         the value that's about to be created
  903. ;         kDETcmdAttributeNew                Attribute value new (return 1 to let normal new processing occur)
  904. ;         kDETcmdAttributeChange            Attribute value change (return 1 to let normal change processing occur)
  905. ;         kDETcmdAttributeDelete            Attribute value delete (return 1 to let normal deletion occur); sent to the
  906. ;                                         main aspect of the attribute that's about to be deleted
  907. ;         kDETcmdPatternIn                Code resource pattern element on reading in an attribute or property
  908. ;         kDETcmdPatternOut                Code resource pattern element on writing out an attribute or property
  909. ;         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from directory)
  910. ;         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  911. ;         kDETcmdOpenSelf                    Self open
  912. ;         kDETcmdConvertToNumber            Convert template-defined property type to number
  913. ;         kDETcmdConvertToRString            Convert template-defined property type to RString
  914. ;         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  915. ;         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  916. ;         kDETcmdCustomViewDraw            Custom view draw
  917. ;         kDETcmdCustomViewMouseDown        Custom view mouse down
  918. ;         kDETcmdCustomViewKeyPress        Custom view key press
  919. ;         kDETcmdCustomViewPaste            Custom view paste
  920. ;         kDETcmdCustomMenuSelected        Custom menu selected
  921. ;         kDETcmdCustomMenuEnabled        Custom menu enabled
  922. ;         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  923. ;         kDETcmdDynamicResource            Return a dynamically created resource
  924.  
  925. ;  Values of DETCallFunctions 
  926. (defconstant $kDETcmdSimpleCall 0)
  927. (defconstant $kDETcmdInit 1)
  928. (defconstant $kDETcmdExit 2)
  929. (defconstant $kDETcmdAttributeCreation 3)
  930. (defconstant $kDETcmdDynamicForwarders 4)
  931.  
  932. (defconstant $kDETcmdTargetedCall 1000)
  933. (defconstant $kDETcmdInstanceInit 1001)
  934. (defconstant $kDETcmdInstanceExit 1002)
  935. (defconstant $kDETcmdIdle 1003)
  936. (defconstant $kDETcmdViewListChanged 1004)
  937. (defconstant $kDETcmdValidateSave 1005)
  938. (defconstant $kDETcmdDropQuery 1006)
  939. (defconstant $kDETcmdDropMeQuery 1007)
  940. (defconstant $kDETcmdAttributeNew 1008)
  941. (defconstant $kDETcmdAttributeChange 1009)
  942. (defconstant $kDETcmdOpenSelf 1010)
  943. (defconstant $kDETcmdDynamicResource 1011)
  944. (defconstant $kDETcmdAttributeDelete 1012)
  945. (defconstant $kDETcmdShouldSync 1013)
  946. (defconstant $kDETcmdDoSync 1014)
  947.  
  948. (defconstant $kDETcmdPropertyCall 2000)
  949. (defconstant $kDETcmdPropertyCommand 2001)
  950. (defconstant $kDETcmdControlEnabled 2002)
  951. (defconstant $kDETcmdMaximumTextLength 2003)
  952. (defconstant $kDETcmdPropertyDirtied 2004)
  953. (defconstant $kDETcmdPatternIn 2005)
  954. (defconstant $kDETcmdPatternOut 2006)
  955. (defconstant $kDETcmdConvertToNumber 2007)
  956. (defconstant $kDETcmdConvertToRString 2008)
  957. (defconstant $kDETcmdConvertFromNumber 2009)
  958. (defconstant $kDETcmdConvertFromRString 2010)
  959. (defconstant $kDETcmdCustomViewDraw 2011)
  960. (defconstant $kDETcmdCustomViewMouseDown 2012)
  961. (defconstant $kDETcmdCustomViewKeyPress 2013)
  962. (defconstant $kDETcmdCustomMenuSelected 2014)
  963. (defconstant $kDETcmdCustomMenuEnabled 2015)
  964. (defconstant $kDETcmdCustomViewPaste 2016)
  965.  
  966. (defconstant $kDETcmdHighCall #XF0000000)
  967.  
  968. (def-mactype :DETCALLFUNCTIONS (find-mactype :SIGNED-LONG))
  969.  
  970. (defrecord DETCallBlockHeader 
  971.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  972.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  973. ;                                             common to all invocations of code resource) 
  974.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  975. ;                                             code resource) 
  976.    (callBack :POINTER)          ;  Pointer to call-back routine 
  977.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  978.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  979.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  980.    )
  981.  
  982. (defrecord DETCallBlockPropertyHeader 
  983.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  984.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  985. ;                                             common to all invocations of code resource) 
  986.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  987. ;                                             code resource) 
  988.    (callBack :POINTER)          ;  Pointer to call-back routine 
  989.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  990.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  991.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  992.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  993.    )
  994.  
  995. (%define-record :DETPROTOCALLBLOCK (find-record-descriptor :DETCALLBLOCKPROPERTYHEADER))
  996.  
  997. (defrecord DETInitBlock 
  998.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  999.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1000. ;                                             common to all invocations of code resource) 
  1001.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1002. ;                                             code resource) 
  1003.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1004.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1005.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1006.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1007.  
  1008.    (newCallFors :SIGNED-LONG)   ;  <-  New call-for mask 
  1009.    )
  1010.  
  1011. (%define-record :DETEXITBLOCK (find-record-descriptor :DETCALLBLOCKHEADER))
  1012.  
  1013. (%define-record :DETINSTANCEINITBLOCK (find-record-descriptor :DETCALLBLOCKHEADER))
  1014.  
  1015. (%define-record :DETINSTANCEEXITBLOCK (find-record-descriptor :DETCALLBLOCKHEADER))
  1016.  
  1017. (%define-record :DETINSTANCEIDLEBLOCK (find-record-descriptor :DETCALLBLOCKHEADER))
  1018.  
  1019. (defrecord DETPropertyCommandBlock 
  1020.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1021.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1022. ;                                             common to all invocations of code resource) 
  1023.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1024. ;                                             code resource) 
  1025.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1026.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1027.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1028.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1029.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1030.  
  1031.    (parameter :SIGNED-LONG)     ;   -> Parameter of command 
  1032.    )
  1033.  
  1034. (defrecord DETControlEnabledBlock 
  1035.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1036.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1037. ;                                             common to all invocations of code resource) 
  1038.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1039. ;                                             code resource) 
  1040.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1041.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1042.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1043.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1044.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1045.  
  1046.    (isEnabled :BOOLEAN)         ;  <-  Return true if the control should be enabled 
  1047.    )
  1048.  
  1049. (defrecord DETMaximumTextLengthBlock 
  1050.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1051.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1052. ;                                             common to all invocations of code resource) 
  1053.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1054. ;                                             code resource) 
  1055.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1056.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1057.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1058.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1059.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1060.  
  1061.    (maxSize :SIGNED-LONG)       ;  <-  Return the maximum size of the property as a text STRING 
  1062.    )
  1063.  
  1064. (%define-record :DETVIEWLISTCHANGEDBLOCK (find-record-descriptor :DETCALLBLOCKHEADER))
  1065.  
  1066. (%define-record :DETPROPERTYDIRTIEDBLOCK (find-record-descriptor :DETCALLBLOCKPROPERTYHEADER))
  1067.  
  1068. (defrecord DETValidateSaveBlock 
  1069.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1070.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1071. ;                                             common to all invocations of code resource) 
  1072.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1073. ;                                             code resource) 
  1074.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1075.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1076.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1077.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1078.  
  1079.    (errorString (:HANDLE :RSTRING));  <-  Handle with error STRING if validation fails (callee must allocate handle, DE will DisposHandle() it) 
  1080.    )
  1081.  
  1082. ;  Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): 
  1083.  
  1084. (defconstant $kDETDoNothing :|xxx0|)
  1085. (defconstant $kDETMove :|move|)
  1086. (defconstant $kDETDrag :|drag|)
  1087. (defconstant $kDETAlias :|alis|)
  1088.  
  1089. (defrecord DETDropQueryBlock 
  1090.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1091.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1092. ;                                             common to all invocations of code resource) 
  1093.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1094. ;                                             code resource) 
  1095.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1096.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1097.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1098.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1099.  
  1100.    (modifiers :SIGNED-INTEGER)  ;   -> Modifiers at drop time (option/control/command/shift keys) 
  1101.    (commandID :SIGNED-LONG)     ;  <-> Command ID (aeDoNothing, aeMove, aeCopy, aeAlias, or a property number) 
  1102.    (destinationType :ATTRIBUTETYPE);  <-> Type to convert attribute to 
  1103.    (copyToHFS :BOOLEAN)         ;  <-  If true, object should be copied to HFS before being operated on, and deleted after 
  1104.    )
  1105.  
  1106. (defrecord DETDropMeQueryBlock 
  1107.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1108.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1109. ;                                             common to all invocations of code resource) 
  1110.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1111. ;                                             code resource) 
  1112.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1113.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1114.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1115.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1116.  
  1117.    (modifiers :SIGNED-INTEGER)  ;   -> Modifiers at drop time (option/control/command/shift keys) 
  1118.    (commandID :SIGNED-LONG)     ;  <-> Command ID (aeDoNothing, aeMove, aeCopy, aeAlias, or a property number) 
  1119.    (destinationType :ATTRIBUTETYPE);  <-> Type to convert attribute to 
  1120.    (copyToHFS :BOOLEAN)         ;  <-  If true, object should be copied to HFS before being operated on, and deleted after 
  1121.    )
  1122.  
  1123. (defrecord DETAttributeCreationBlock 
  1124.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1125.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1126. ;                                             common to all invocations of code resource) 
  1127.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1128. ;                                             code resource) 
  1129.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1130.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1131.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1132.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1133.  
  1134.    (parent (:POINTER :PACKEDDSSPEC));   -> The object within which the creation will occur 
  1135.    (refNum :SIGNED-INTEGER)     ;   -> Refnum for returned address (DSSpecs in PDs only) 
  1136.    (identity :SIGNED-LONG)      ;   -> The identity we're browsing as in the parent object 
  1137.    (attrType :ATTRIBUTETYPE)    ;  <-> The type of the attribute being created 
  1138.    (attrTag :OSTYPE)            ;  <-> The tag of the attribute being created 
  1139.    (value :HANDLE)              ;  <-> The value to write (pre-allocated, resize as needed) 
  1140.    )
  1141.  
  1142. (defrecord DETAttributeNewBlock 
  1143.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1144.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1145. ;                                             common to all invocations of code resource) 
  1146.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1147. ;                                             code resource) 
  1148.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1149.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1150.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1151.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1152.  
  1153.    (parent (:POINTER :PACKEDDSSPEC));   -> The object within which the creation will occur 
  1154.    (refNum :SIGNED-INTEGER)     ;   -> Refnum for returned address (DSSpecs in PDs only) 
  1155.    (identity :SIGNED-LONG)      ;   -> The identity we're browsing as in the parent object 
  1156.    (attrType :ATTRIBUTETYPE)    ;  <-> The type of the attribute being created 
  1157.    (attrTag :OSTYPE)            ;  <-> The tag of the attribute being created 
  1158.    (value :HANDLE)              ;  <-> The value to write (pre-allocated, resize as needed) 
  1159.    )
  1160.  
  1161. (defrecord DETAttributeChangeBlock 
  1162.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1163.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1164. ;                                             common to all invocations of code resource) 
  1165.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1166. ;                                             code resource) 
  1167.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1168.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1169.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1170.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1171.  
  1172.    (parent (:POINTER :PACKEDDSSPEC));   -> The object within which the creation will occur 
  1173.    (refNum :SIGNED-INTEGER)     ;   -> Refnum for returned address (DSSpecs in PDs only) 
  1174.    (identity :SIGNED-LONG)      ;   -> The identity we're browsing as in the parent object 
  1175.    (attrType :ATTRIBUTETYPE)    ;  <-> The type of the attribute being changed 
  1176.    (attrTag :OSTYPE)            ;  <-> The tag of the attribute being changed 
  1177.    (attrCID :CREATIONID)        ;  <-> The CID of the attribute being changed 
  1178.    (value :HANDLE)              ;  <-> The value to write (pre-allocated, resize as needed) 
  1179.    (addAgain :BOOLEAN)          ;  <-  True if returned attribute should be added rather than changed (when returning 1) 
  1180.    )
  1181.  
  1182. (defrecord DETAttributeDeleteBlock 
  1183.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1184.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1185. ;                                             common to all invocations of code resource) 
  1186.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1187. ;                                             code resource) 
  1188.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1189.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1190.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1191.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1192.  
  1193.    (dsSpec (:POINTER :PACKEDDSSPEC));   -> The object within which the deletion will occur 
  1194.    (refNum :SIGNED-INTEGER)     ;   -> Refnum for returned address (DSSpecs in PDs only) 
  1195.    (identity :SIGNED-LONG)      ;   -> The identity we're browsing as 
  1196.    )
  1197.  
  1198. (defrecord DETShouldSyncBlock 
  1199.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1200.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1201. ;                                             common to all invocations of code resource) 
  1202.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1203. ;                                             code resource) 
  1204.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1205.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1206.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1207.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1208.  
  1209.    (shouldSync :BOOLEAN)        ;  <-  True if we should now sync with directory 
  1210.    )
  1211.  
  1212. (defrecord DETDoSyncBlock 
  1213.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1214.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1215. ;                                             common to all invocations of code resource) 
  1216.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1217. ;                                             code resource) 
  1218.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1219.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1220.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1221.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1222.    )
  1223.  
  1224. (defrecord DETPatternInBlock 
  1225.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1226.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1227. ;                                             common to all invocations of code resource) 
  1228.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1229. ;                                             code resource) 
  1230.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1231.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1232.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1233.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1234.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1235.  
  1236.    (elementType :SIGNED-LONG)   ;   -> Element type from pattern 
  1237.    (extra :SIGNED-LONG)         ;   -> Extra field from pattern 
  1238.    (attribute (:POINTER :ATTRIBUTE));   -> The complete attribute 
  1239.    (dataOffset :SIGNED-LONG)    ;   -> Offset to current (next) byte 
  1240.    (bitOffset :SIGNED-INTEGER)  ;   -> Bit offset (next bit ^is fData >> fBitOffset++) 
  1241.    )
  1242.  
  1243. (defrecord DETPatternOutBlock 
  1244.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1245.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1246. ;                                             common to all invocations of code resource) 
  1247.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1248. ;                                             code resource) 
  1249.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1250.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1251.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1252.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1253.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1254.  
  1255.    (elementType :SIGNED-LONG)   ;   -> Element type from pattern 
  1256.    (extra :SIGNED-LONG)         ;   -> Extra field from pattern 
  1257.    (attribute (:POINTER :ATTRIBUTE));   -> The attribute (minus the data portion) 
  1258.    (data :HANDLE)               ;   -> Data to be written (pre-allocated, resize and add at end) 
  1259.    (dataOffset :SIGNED-LONG)    ;   -> Offset to next byte to write 
  1260.    (bitOffset :SIGNED-INTEGER)  ;   -> Bit offset (zero: if; handle will need to be resized to one more byte before write) 
  1261.    )
  1262.  
  1263. (defrecord DETOpenSelfBlock 
  1264.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1265.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1266. ;                                             common to all invocations of code resource) 
  1267.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1268. ;                                             code resource) 
  1269.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1270.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1271.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1272.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1273.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1274.  
  1275.    (modifiers :SIGNED-INTEGER)  ;  -> Modifiers at open time (option/control/command/shift keys) 
  1276.    )
  1277.  
  1278. (defrecord DETConvertToNumberBlock 
  1279.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1280.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1281. ;                                             common to all invocations of code resource) 
  1282.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1283. ;                                             code resource) 
  1284.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1285.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1286.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1287.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1288.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1289.  
  1290.    (theValue :SIGNED-LONG)      ;  <-  The converted value to return 
  1291.    )
  1292.  
  1293. (defrecord DETConvertToRStringBlock 
  1294.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1295.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1296. ;                                             common to all invocations of code resource) 
  1297.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1298. ;                                             code resource) 
  1299.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1300.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1301.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1302.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1303.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1304.  
  1305.    (theValue (:HANDLE :RSTRING));  <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) 
  1306.    )
  1307.  
  1308. (defrecord DETConvertFromNumberBlock 
  1309.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1310.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1311. ;                                             common to all invocations of code resource) 
  1312.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1313. ;                                             code resource) 
  1314.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1315.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1316.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1317.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1318.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1319.  
  1320.    (theValue :SIGNED-LONG)      ;   -> The value to convert (result should be written direct to the property) 
  1321.    )
  1322.  
  1323. (defrecord DETConvertFromRStringBlock 
  1324.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1325.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1326. ;                                             common to all invocations of code resource) 
  1327.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1328. ;                                             code resource) 
  1329.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1330.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1331.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1332.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1333.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1334.  
  1335.    (theValue (:POINTER :RSTRING));   -> The value to convert (result should be written direct to the property) 
  1336.    )
  1337.  
  1338. (%define-record :DETCUSTOMVIEWDRAWBLOCK (find-record-descriptor :DETCALLBLOCKPROPERTYHEADER))
  1339.  
  1340. (defrecord DETCustomViewMouseDownBlock 
  1341.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1342.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1343. ;                                             common to all invocations of code resource) 
  1344.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1345. ;                                             code resource) 
  1346.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1347.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1348.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1349.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1350.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1351.  
  1352.    (theEvent (:POINTER :EVENTRECORD));   -> The original event record of the mouse-down 
  1353.    )
  1354.  
  1355. (defrecord DETCustomViewKeyPressBlock 
  1356.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1357.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1358. ;                                             common to all invocations of code resource) 
  1359.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1360. ;                                             code resource) 
  1361.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1362.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1363.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1364.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1365.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1366.  
  1367.    (theEvent (:POINTER :EVENTRECORD));   -> The original event record of the key-press 
  1368.    )
  1369.  
  1370. (defrecord DETCustomViewPasteBlock 
  1371.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1372.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1373. ;                                             common to all invocations of code resource) 
  1374.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1375. ;                                             code resource) 
  1376.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1377.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1378.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1379.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1380.    (property :SIGNED-INTEGER)   ;  The property number the call refers to 
  1381.  
  1382.    (modifiers :SIGNED-INTEGER)  ;  -> Modifiers at paste time (option/control/command/shift keys) 
  1383.    )
  1384.  
  1385. (defrecord DETCustomMenuSelectedBlock 
  1386.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1387.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1388. ;                                             common to all invocations of code resource) 
  1389.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1390. ;                                             code resource) 
  1391.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1392.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1393.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1394.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1395.  
  1396.    (menuTableParameter :SIGNED-INTEGER);   -> The "property" field from the custom menu table 
  1397.    )
  1398.  
  1399. (defrecord DETCustomMenuEnabledBlock 
  1400.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1401.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1402. ;                                             common to all invocations of code resource) 
  1403.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1404. ;                                             code resource) 
  1405.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1406.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1407.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1408.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1409.  
  1410.    (menuTableParameter :SIGNED-INTEGER);   -> The "property" field from the custom menu table 
  1411.    (enable :BOOLEAN)            ;  <-  Whether to enable the menu item 
  1412.    )
  1413.  
  1414. (defrecord DETForwarderListItem 
  1415.    (next (:POINTER :DETFORWARDERLISTPTR));  Pointer to next item, or nil 
  1416.    (attributeValueTag :OSTYPE)  ;  Tag of new templates (0 for none) 
  1417.    (rstrs :PACKEDPATHNAME)      ;  Record type (empty if none), attrbute type (empty if none),
  1418. ;                                             aspect names to forward to, and info-page names to forward to 
  1419.    )
  1420.  
  1421. (def-mactype :DETFORWARDERLISTPTR (find-mactype :POINTER))
  1422. (def-mactype :DETFORWARDERLISTHANDLE (find-mactype :HANDLE))
  1423.  
  1424. (defrecord DETDynamicForwardersBlock 
  1425.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1426.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1427. ;                                             common to all invocations of code resource) 
  1428.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1429. ;                                             code resource) 
  1430.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1431.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1432.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1433.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1434.  
  1435.    (forwarders (:HANDLE :DETFORWARDERLISTITEM));  <-  List of forwaders 
  1436.    )
  1437.  
  1438. (defrecord DETDynamicResourceBlock 
  1439.    (reqFunction :SIGNED-LONG)   ;  Requested function 
  1440.    (templatePrivate :SIGNED-LONG);  Private storage for use by code resource (stays for life of code resource,
  1441. ;                                             common to all invocations of code resource) 
  1442.    (instancePrivate :SIGNED-LONG);  Private storage for use by code resource (separate for each item using the
  1443. ;                                             code resource) 
  1444.    (callBack :POINTER)          ;  Pointer to call-back routine 
  1445.    (callBackPrivate :SIGNED-LONG);  Private data for the call-back routine 
  1446.    (target :DETTARGETSPECIFICATION);  The target (originator) of the call, for targeted and property calls 
  1447.    (targetIsMainAspect :BOOLEAN);  True if the target is the main aspect (even though it has a non-nil name) 
  1448.  
  1449.    (resourceType :OSTYPE)       ;   -> The resource type being requested 
  1450.    (propertyNumber :SIGNED-INTEGER);   -> The property number of the resource being requested 
  1451.    (resourceID :SIGNED-INTEGER) ;   -> The resource ID (base ID + property number) of the resource 
  1452.    (theResource :HANDLE)        ;  <-  The requested resource 
  1453.    )
  1454.  
  1455. (defrecord DETCallBlock 
  1456.    (:variant 
  1457.       ((protoCall :DETCALLBLOCKPROPERTYHEADER))
  1458.       ((init :DETINITBLOCK))
  1459.       ((exit :DETCALLBLOCKHEADER))
  1460.       ((instanceInit :DETCALLBLOCKHEADER))
  1461.       ((instanceExit :DETCALLBLOCKHEADER))
  1462.       ((instanceIdle :DETCALLBLOCKHEADER))
  1463.       ((propertyCommand :DETPROPERTYCOMMANDBLOCK))
  1464.       ((controlEnabled :DETCONTROLENABLEDBLOCK))
  1465.       ((maximumTextLength :DETMAXIMUMTEXTLENGTHBLOCK))
  1466.       ((viewListChanged :DETCALLBLOCKHEADER))
  1467.       ((propertyDirtied :DETCALLBLOCKPROPERTYHEADER))
  1468.       ((validateSave :DETVALIDATESAVEBLOCK))
  1469.       ((dropQuery :DETDROPQUERYBLOCK))
  1470.       ((dropMeQuery :DETDROPMEQUERYBLOCK))
  1471.       ((attributeCreationBlock :DETATTRIBUTECREATIONBLOCK))
  1472.       ((attributeNew :DETATTRIBUTENEWBLOCK))
  1473.       ((attributeChange :DETATTRIBUTECHANGEBLOCK))
  1474.       ((attributeDelete :DETATTRIBUTEDELETEBLOCK))
  1475.       ((patternIn :DETPATTERNINBLOCK))
  1476.       ((patternOut :DETPATTERNOUTBLOCK))
  1477.       ((shouldSync :DETSHOULDSYNCBLOCK))
  1478.       ((doSync :DETDOSYNCBLOCK))
  1479.       ((openSelf :DETOPENSELFBLOCK))
  1480.       ((convertToNumber :DETCONVERTTONUMBERBLOCK))
  1481.       ((convertToRString :DETCONVERTTORSTRINGBLOCK))
  1482.       ((convertFromNumber :DETCONVERTFROMNUMBERBLOCK))
  1483.       ((convertFromRString :DETCONVERTFROMRSTRINGBLOCK))
  1484.       ((customViewDraw :DETCALLBLOCKPROPERTYHEADER))
  1485.       ((customViewMouseDown :DETCUSTOMVIEWMOUSEDOWNBLOCK))
  1486.       ((customViewKeyPress :DETCUSTOMVIEWKEYPRESSBLOCK))
  1487.       ((customViewPaste :DETCUSTOMVIEWPASTEBLOCK))
  1488.       ((customMenuSelected :DETCUSTOMMENUSELECTEDBLOCK))
  1489.       ((customMenuEnabled :DETCUSTOMMENUENABLEDBLOCK))
  1490.       ((dynamicForwarders :DETDYNAMICFORWARDERSBLOCK))
  1491.       ((dynamicResource :DETDYNAMICRESOURCEBLOCK))
  1492.       ))
  1493.  
  1494. (def-mactype :DETCALLBLOCKPTR (find-mactype :POINTER))
  1495.  
  1496. ;  Call-for list: 
  1497.  
  1498. (defconstant $kDETCallForAnything 1);  Call at all 
  1499. (defconstant $kDETCallForIdle 2);  kDETcmdIdle 
  1500. (defconstant $kDETCallForCommands 4);  kDETcmdPropertyCommand, kDETcmdSelfOpen 
  1501. (defconstant $kDETCallForViewChanges 8);  kDETcmdControlEnabled, kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength 
  1502. (defconstant $kDETCallForDrops #X10);  kDETcmdDropQuery, kDETcmdDropMeQuery 
  1503. (defconstant $kDETCallForAttributes #X20);  kDETcmdAttributeNew, kDETcmdAttributeChange 
  1504. (defconstant $kDETCallForValidation #X40);  kDETcmdValidateSave 
  1505. (defconstant $kDETCallForKeyPresses #X80);  kDETcmdCustomViewKeyPress and kDETcmdCustomViewPaste on all key-presses 
  1506. (defconstant $kDETCallForResources #X100);  kDETcmdDynamicResource 
  1507. (defconstant $kDETCallForSyncing #X200);  kDETcmdShouldSync, kDETcmdDoSync 
  1508. (defconstant $kDETCallForEscalation #X8000);  all calls escalated to the next level 
  1509.  
  1510. (defconstant $kDETCallForNothing 0);  none of the above 
  1511. (defconstant $kDETCallForEverything #XFFFFFFFF);  all of the above 
  1512.  
  1513. (def-mactype :DETCALL (find-mactype :POINTER));  FUNCTION DETCall(callBlockPtr: DETCallBlockPtr): OSErr;
  1514.  
  1515. ;  This following macro saves you from having to dig out the call-back pointer from the call block: 
  1516.  
  1517. ;  #define CallBackDET(callBlockPtr, callBackBlockPtr) ((*callBlockPtr->protoCall.callBack)(callBlockPtr, callBackBlockPtr)) 
  1518.  
  1519. ;  Errors specific to Directories Extension Templates 
  1520.  
  1521. ;  Note: This section will be moved to OCEErrors.h eventually 
  1522.  
  1523. ;  ************************************************************************************ 
  1524. ;  ********************************* SAM Definitions: ********************************* 
  1525. ;  ************************************************************************************ 
  1526.  
  1527. ;  SAM Developers should use property numbers starting at this point: 
  1528.  
  1529. (defconstant $kSAMFirstDevProperty (+ #$KDETFIRSTDEVPROPERTY 10))
  1530.  
  1531. ;     SAM templates have additional resources/properties that are required
  1532. ;     for interaction with the A.O.C.E. Connections control panel.
  1533. ;     
  1534. ;      Type    Offset                        Description
  1535. ;      ----    ------                        -----------
  1536. ;     'rstr'    kSAMAspectStatus            The string displayed as the slot's status
  1537. ;     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  1538. ;     'detn'    kSAMAspectServesDSAM        If 0, not a DSAM template, otherwise is a DSAM template
  1539. ;     'detn'    kSAMAspectServesMSAM        If 0, not an MSAM template, otherwise is an MSAM template
  1540. ;     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  1541.  
  1542. (defconstant $kSAMAspectStatus (+ #$KDETFIRSTDEVPROPERTY 1))
  1543. (defconstant $kSAMAspectCannotDelete (+ #$KDETFIRSTDEVPROPERTY 2))
  1544. (defconstant $kSAMAspectServesDSAM (+ #$KDETFIRSTDEVPROPERTY 3))
  1545. (defconstant $kSAMAspectServesMSAM (+ #$KDETFIRSTDEVPROPERTY 4))
  1546. (defconstant $kSAMAspectSlotCreationInfo (+ #$KDETFIRSTDEVPROPERTY 5))
  1547.  
  1548. ;     The standard "Status" RStrings are stored in an rst# resource.
  1549. ;     Here is the resource ID and the indices into the resource 
  1550.  
  1551. (defconstant $kSAMStatusStrings -16523)
  1552. (defconstant $kSAMNotSetup 1)
  1553. (defconstant $kSAMActive 2)
  1554. (defconstant $kSAMInactive 3)
  1555.  
  1556. ;  ************************************************************************************** 
  1557. ;  ********************************* Admin Definitions: ********************************* 
  1558. ;  ************************************************************************************** 
  1559.  
  1560. (defconstant $kDETAdminVersion -978)
  1561.  
  1562. ; $ENDC                         ;  UsingOCETemplates 
  1563.  
  1564. ; $IFC NOT UsingIncludes
  1565.  
  1566. ; $ENDC
  1567.  
  1568. (export '($KDETADMINVERSION $KSAMINACTIVE $KSAMACTIVE $KSAMNOTSETUP
  1569.           $KSAMSTATUSSTRINGS $KSAMASPECTSLOTCREATIONINFO $KSAMASPECTSERVESMSAM
  1570.           $KSAMASPECTSERVESDSAM $KSAMASPECTCANNOTDELETE $KSAMASPECTSTATUS
  1571.           $KSAMFIRSTDEVPROPERTY $KDETCALLFOREVERYTHING $KDETCALLFORNOTHING
  1572.           $KDETCALLFORESCALATION $KDETCALLFORSYNCING $KDETCALLFORRESOURCES
  1573.           $KDETCALLFORKEYPRESSES $KDETCALLFORVALIDATION $KDETCALLFORATTRIBUTES
  1574.           $KDETCALLFORDROPS $KDETCALLFORVIEWCHANGES $KDETCALLFORCOMMANDS
  1575.           $KDETCALLFORIDLE $KDETCALLFORANYTHING $KDETALIAS $KDETDRAG $KDETMOVE
  1576.           $KDETDONOTHING $KDETCMDHIGHCALL $KDETCMDCUSTOMVIEWPASTE
  1577.           $KDETCMDCUSTOMMENUENABLED $KDETCMDCUSTOMMENUSELECTED
  1578.           $KDETCMDCUSTOMVIEWKEYPRESS $KDETCMDCUSTOMVIEWMOUSEDOWN
  1579.           $KDETCMDCUSTOMVIEWDRAW $KDETCMDCONVERTFROMRSTRING
  1580.           $KDETCMDCONVERTFROMNUMBER $KDETCMDCONVERTTORSTRING
  1581.           $KDETCMDCONVERTTONUMBER $KDETCMDPATTERNOUT $KDETCMDPATTERNIN
  1582.           $KDETCMDPROPERTYDIRTIED $KDETCMDMAXIMUMTEXTLENGTH
  1583.           $KDETCMDCONTROLENABLED $KDETCMDPROPERTYCOMMAND $KDETCMDPROPERTYCALL
  1584.           $KDETCMDDOSYNC $KDETCMDSHOULDSYNC $KDETCMDATTRIBUTEDELETE
  1585.           $KDETCMDDYNAMICRESOURCE $KDETCMDOPENSELF $KDETCMDATTRIBUTECHANGE
  1586.           $KDETCMDATTRIBUTENEW $KDETCMDDROPMEQUERY $KDETCMDDROPQUERY
  1587.           $KDETCMDVALIDATESAVE $KDETCMDVIEWLISTCHANGED $KDETCMDIDLE
  1588.           $KDETCMDINSTANCEEXIT $KDETCMDINSTANCEINIT $KDETCMDTARGETEDCALL
  1589.           $KDETCMDDYNAMICFORWARDERS $KDETCMDATTRIBUTECREATION $KDETCMDEXIT
  1590.           $KDETCMDINIT $KDETCMDSIMPLECALL $KDETLASTITEMTYPE $KDETMOVERTYPE
  1591.           $KDETMAILTYPE $KDETDSTYPE $KDETHFSTYPE $KDETCMDHIGHCALLBACK
  1592.           $KDETCMDGETRESOURCE $KDETCMDGETCUSTOMVIEWBOUNDS
  1593.           $KDETCMDGETCUSTOMVIEWUSERREFERENCE $KDETCMDSAVEPROPERTY
  1594.           $KDETCMDMENUITEMRSTRING $KDETCMDREMOVEMENU $KDETCMDADDMENU
  1595.           $KDETCMDDIRTYPROPERTY $KDETCMDSETPROPERTYEDITABLE
  1596.           $KDETCMDSETPROPERTYCHANGED $KDETCMDSETPROPERTYBINARY
  1597.           $KDETCMDSETPROPERTYRSTRING $KDETCMDSETPROPERTYNUMBER
  1598.           $KDETCMDSETPROPERTYTYPE $KDETCMDGETPROPERTYEDITABLE
  1599.           $KDETCMDGETPROPERTYCHANGED $KDETCMDGETPROPERTYBINARY
  1600.           $KDETCMDGETPROPERTYBINARYSIZE $KDETCMDGETPROPERTYRSTRING
  1601.           $KDETCMDGETPROPERTYNUMBER $KDETCMDGETPROPERTYTYPE
  1602.           $KDETCMDPROPERTYCALLBACK $KDETCMDCLOSEEDIT $KDETCMDGETOPENEDIT
  1603.           $KDETCMDGETTEMPLATEFSSPEC $KDETCMDBREAKATTRIBUTE $KDETCMDREQUESTSYNC
  1604.           $KDETCMDSELECTEDSUBLISTCOUNT $KDETCMDSUBLISTCOUNT $KDETCMDGETDSSPEC
  1605.           $KDETCMDTARGETEDCALLBACK $KDETCMDTEMPLATECOUNTS
  1606.           $KDETCMDUNLOADTEMPLATES $KDETCMDABOUTTOTALK $KDETCMDOPENDSSPEC
  1607.           $KDETCMDGETCOMMANDITEMN $KDETCMDGETCOMMANDSELECTIONCOUNT
  1608.           $KDETCMDCHANGECALLFORS $KDETCMDBUSY $KDETCMDBEEP
  1609.           $KDETCMDSIMPLECALLBACK $KDETDIDNOTHANDLE $KDETHIGHSELECTOR
  1610.           $KDETINFOPAGETEMPLATE $KDETASPECTTEMPLATE $KDETCHAINEDTARGETSPEC
  1611.           $KDETDSSPEC $KDETSELECTEDSUBLISTITEM $KDETSUBLISTITEM $KDETPARENT
  1612.           $KDETSELFOTHERASPECT $KDETSELF $KDETCATEGORYPEOPLE
  1613.           $KDETCATEGORYADDRESSITEMS $KDETCATEGORYALLITEMS
  1614.           $KDETCATEGORYALLCATEGORIES $KDETFORWARDERTEMPLATENAMES
  1615.           $KDETKILLERNAME $KDETSUBLISTKINDCOLUMNRIGHT
  1616.           $KDETSUBLISTKINDCOLUMNLEFT $KDETSUBLISTNAMECOLUMNRIGHT
  1617.           $KDETSUBLISTNAMECOLUMNLEFT $KDETSUBLISTICONCOLUMNRIGHT
  1618.           $KDETSUBLISTICONCOLUMNLEFT $KDETSUBLISTSPACEBETWEENCOLUMNS
  1619.           $KDETSUBLISTKINDCOLUMNWIDTH $KDETSUBLISTNAMECOLUMNWIDTH
  1620.           $KDETSUBLISTICONCOLUMNWIDTH $KDETSUBLISTTITLEBOTTOM
  1621.           $KDETSUBLISTTITLETOP $KDETSUBLISTENTRYBOTTOM $KDETSUBLISTENTRYTOP
  1622.           $KDETSUBLISTRIGHT $KDETSUBLISTRIGHTINSET $KDETSUBLISTBOTTOM
  1623.           $KDETSUBLISTBOTTOMINSET $KDETSUBLISTLEFT $KDETSUBLISTTOP
  1624.           $KDETCOLUMNTOP $KDETATTRIBUTE2NDCOLUMNRIGHT $KDETRECORD2NDCOLUMNRIGHT
  1625.           $KDET2NDCOLUMNLEFT $KDET1STCOLUMNRIGHT $KDET1STCOLUMNLEFT
  1626.           $KDETSUBPAGE1BUTTONRIGHT $KDETSUBPAGE1BUTTONBOTTOM
  1627.           $KDETSUBPAGE1BUTTONLEFT $KDETSUBPAGE1BUTTONTOP $KDETSUBPAGELABELRIGHT
  1628.           $KDETSUBPAGELABELBOTTOM $KDETSUBPAGELABELLEFT $KDETSUBPAGELABELTOP
  1629.           $KDETSUBPAGEICONRIGHT $KDETSUBPAGEICONBOTTOM $KDETSUBPAGEICONLEFT
  1630.           $KDETSUBPAGEICONTOP $KDETSUBPAGERIGHTINSET $KDETSUBPAGEBOTTOMINSET
  1631.           $KDETSUBPAGELEFT $KDETSUBPAGETOP $KDETATTRIBUTEINFOWINDWIDTH
  1632.           $KDETATTRIBUTEINFOWINDHEIGHT $KDETRECORDINFOWINDWIDTH
  1633.           $KDETRECORDINFOWINDHEIGHT $KDETCHANGEVIEWCOMMAND
  1634.           $KDETCUSTOMVIEWMENUID $KDETICONSTYLE $KDETEXTEND $KDETCONDENSE
  1635.           $KDETSHADOW $KDETOUTLINE $KDETUNDERLINE $KDETITALIC $KDETBOLD
  1636.           $KDETNORMAL $KDETDEFAULTFONTLINEHEIGHT $KDETDEFAULTFONTSIZE
  1637.           $KDETDEFAULTFONT $KDETSYSTEMFONTLINEHEIGHT $KDETSYSTEMFONTSIZE
  1638.           $KDETSYSTEMFONT $KDETAPPFONTLINEHEIGHT $KDETAPPLICATIONFONTSIZE
  1639.           $KDETAPPLICATIONFONT $KDETBOXISINVISIBLE $KDETBOXISGRAYED
  1640.           $KDETBOXISROUNDED $KDETBOXTAKESCONTENTCLICKS $KDETNOPROPERTY
  1641.           $KDETNOSORT $KDETNOVALUE $KDETUNUSED $KDETFORCELEFT $KDETRIGHT
  1642.           $KDETCENTER $KDETLEFT $KDETMINIICON $KDETSMALLICON $KDETLARGEICON
  1643.           $KDETALLOWNOCOLONS $KDETDYNAMICSIZE $KDETHIDEPENONOPEN
  1644.           $KDETVIEWSENDCOMMANDTOWINDOW $KDETMULTILINE $KDETNUMERICONLY
  1645.           $KDETCHOOSABLE $KDETHILIGHTIFSELECTED $KDETENABLED $KDETNOFLAGS
  1646.           $KDETINFOPAGEMENUENTRIES $KDETINFOPAGEMENUNAME
  1647.           $KDETINFOPAGEMAINVIEWASPECT $KDETINFOPAGENAME $KDETPRTYPEBINARY
  1648.           $KDETPRTYPESTRING $KDETPRTYPENUMBER $KDETPRTYPENONE
  1649.           $KDETINFOPAGETEMPLATENUMBER $KDETASPECTTEMPLATENUMBER
  1650.           $KDETPRIMARYTOPMASKBIT $KDETPRIMARYCHANGEPRIVSMASK
  1651.           $KDETPRIMARYRENAMEMASK $KDETPRIMARYCHANGEMASK $KDETPRIMARYDELETEMASK
  1652.           $KDETPRIMARYADDMASK $KDETPRIMARYSEEMASK $KDETPRIMARYMASKBYBIT
  1653.           $KDETATTRIBUTEACCESSMASK $KDETRECORDACCESSMASK $KDETDNODEACCESSMASK
  1654.           $KDETPRKIND $KDETPRNAME $KDETTRUEPROPERTY $KDETFALSEPROPERTY
  1655.           $KDETONEPROPERTY $KDETZEROPROPERTY $KDETCONSTANTPROPERTY
  1656.           $KDETLASTCONSTANTPROPERTY $KDETFIRSTCONSTANTPROPERTY
  1657.           $KDETFIRSTDEVPROPERTY $KDETLASTLOCALPROPERTY $KDETFIRSTLOCALPROPERTY
  1658.           $KDETASPECTEXTERNALCATEGORY $KDETASPECTINFOPAGECUSTOMWINDOW
  1659.           $KDETASPECTREVERSESORT $KDETASPECTVIEWMENU $KDETASPECTATTRDRAGOUT
  1660.           $KDETASPECTATTRDRAGIN $KDETASPECTRECORDCATDRAGIN
  1661.           $KDETASPECTRECORDDRAGIN $KDETASPECTDRAGINSUMMARY
  1662.           $KDETASPECTDRAGINVERB $KDETASPECTDRAGINSTRING $KDETASPECTLOOKUP
  1663.           $KDETASPECTNEWVALUE $KDETASPECTNEWENTRYNAME $KDETASPECTNEWMENUNAME
  1664.           $KDETASPECTBALLOONS $KDETASPECTMAINBITMAP $KDETASPECTWHATIS
  1665.           $KDETASPECTGENDER $KDETASPECTKIND $KDETASPECTCATEGORY $KDETASPECTNAME
  1666.           $KDETASPECTCODE $KDETATTRIBUTEVALUETAG $KDETATTRIBUTETYPE
  1667.           $KDETRECORDTYPE $KDETTEMPLATENAME $KDETFIFTHID $KDETFOURTHID
  1668.           $KDETTHIRDID $KDETSECONDID $KDETFIRSTID $KDETIDSEP
  1669.           $KDETFILETYPEVERSION $KDETFORWARDERVERSION $KDETKILLERVERSION
  1670.           $KDETINFOPAGEVERSION $KDETASPECTVERSION))
  1671. (provide-interface 'OCETemplates)